package com.gxc.controller;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Demo Controller.
 *
 * @author 宫新程
 * @since 2018/11/18 7:09 PM
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

  private final Logger log = LoggerFactory.getLogger(getClass());

  @RequestMapping(value = "/hello", method = RequestMethod.GET)
  public Map hello() {
    List<String> list = Arrays.asList("Hello", "World", "！");
    list.forEach(System.out::println);

    Map map = new HashMap();
    map.put("name", "GXC");
    map.put("age", "22");

    log.info("Hello World ！");

    return map;
  }
}
